package siau.android.base

import android.content.Intent
import android.os.Bundle
import android.view.View
import android.widget.LinearLayout
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
import com.alibaba.android.arouter.launcher.ARouter
import com.igexin.sdk.PushManager
import hhm.android.base.activity.mainActivity.MainActivity
import hhm.android.library.utils.DataStoreUtils
import hhm.android.library.utils.OnMultiClickListener
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.MainScope
import kotlinx.coroutines.async
import siau.android.library.KeyString

class ChangeFamilyDialog : AppCompatActivity(), CoroutineScope by MainScope() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_change_family)

        val btn = findViewById<LinearLayout>(R.id.activity_change_family_btn)

        btn.setOnClickListener(object : OnMultiClickListener() {
            override fun onMultiClick(v: View?) {

                SBApplication.clearBlueToothData()
                SBApplication.communityChildId = -1
//                SBApplication.startCalculate.value = false
                SBApplication.refreshMainActivityUI = false
                SBApplication.becomeCreator = false

                ARouter.getInstance().build(MAIN_ROUTER).withFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK).navigation()
                finish()
            }
        })
    }

    override fun onBackPressed() {
    }
}